class Cat:
    # 构造方法
    def __init__(self):
        self.name = "kaka"


# 对象实例化，构造方法自动运行
cat = Cat()
print(cat.name)
print("-" * 200)


class Dog:
    def __init__(self):
        self.name = "麦芽"
        self.age = 2

    def speck(self):
        # 字符串乘以数字，表示字符串重复多少次
        return "喵" * self.age


dog = Dog()
print(dog.name)
print(dog.speck())
print("-" * 200)


class Human:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def printInfo(self):
        print(f"姓名：{self.name}")


class Student(Human):  # 继承
    def __init__(self, name, age, height):
        # super后有括号
        super().__init__(name,age)
        self.height = height

student = Student("张三",10,1.8)
student.printInfo()

